home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / MacSource / Stdio_p2w.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-14  |  3.6 KB  |  96 lines  |  [TEXT/CWIE]

  1. /*
  2. ==============================================================================
  3. Project:    POV-Ray
  4.  
  5. Version:    3
  6.  
  7. File Name:    Stdio_p2w.h
  8.  
  9. Description:
  10.     General-purpose printf-capturing routines that allow a console-like
  11.     output window for c programs that otherwise prefer to use printf/fprintf.
  12.     This code was "inspired heavily" from sources such as MacDTS'es TESample,
  13.     MacApp's Transcript window, and previous code of mine.  It is fairly well
  14.     self-contained, and works in MPW C 3.2 and Think C 5.0.
  15.  
  16.     This file contains global definitions used by any source files that would
  17.     otherwise include <stdio.h>.. that is, non-Macintosh-toolbox-aware.  It is
  18.     _REQUIRED_ that those files be modified to include "stdio_p2w.h" instead of
  19.     <stdio.h>, since this header will include <stdio.h> for them.
  20.     NOTE: If stdio.h is included after this header, problems will occur.
  21.  
  22. Related Files:
  23.     Stdio_p2w.h        - generic header for sources that would otherwise use <stdio.h>
  24.     Printf2Window.h    - Mac-specific header for p2w routines
  25.     Printf2Window.c    - the main source for the p2w routines
  26. ------------------------------------------------------------------------------
  27. Author:
  28.     Eduard [esp] Schwan
  29. ------------------------------------------------------------------------------
  30.     from Persistence of Vision(tm) Ray Tracer
  31.     Copyright 1996 Persistence of Vision Team
  32. ------------------------------------------------------------------------------
  33.     NOTICE: This source code file is provided so that users may experiment
  34.     with enhancements to POV-Ray and to port the software to platforms other 
  35.     than those supported by the POV-Ray Team.  There are strict rules under
  36.     which you are permitted to use this file.  The rules are in the file
  37.     named POVLEGAL.DOC which should be distributed with this file. If 
  38.     POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  39.     Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  40.     Forum.  The latest version of POV-Ray may be found there as well.
  41.  
  42.     This program is based on the popular DKB raytracer version 2.12.
  43.     DKBTrace was originally written by David K. Buck.
  44.     DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  45. ------------------------------------------------------------------------------
  46. Change History:
  47.     920326    [esp]    Created.
  48.     920330    [esp]    Updated file header with copyright & related files info
  49.     920424  (jln)   removed putc definition to avoid problems writing Targa format.
  50.     920621    [esp]    Changed file header definition to STDIOP2W_H for ANSI consistency
  51.     931001    [esp]    version 2.0 finished (Released on 10/4/93)
  52. ==============================================================================
  53. */
  54.  
  55. #if !defined (STDIOP2W_H)
  56. #define STDIOP2W_H
  57.  
  58. #include "config.h"
  59.  
  60. #include <stdio.h>
  61.  
  62.  
  63. // ==== <stdio.h> replacement macros (Forces std C i/o to call us instead)
  64.  
  65. #undef    fflush
  66. #undef    fprintf
  67. #undef    fputc
  68. #undef    fputs
  69. #undef    printf
  70. // #undef    putc    -- let it pass for now [esp]
  71. #undef    putchar
  72. #undef    puts
  73.  
  74. #define fflush        p2w_fflush
  75. #define fprintf        p2w_fprintf
  76. #define fputc        p2w_fputc
  77. #define fputs        p2w_fputs
  78. #define printf        p2w_printf
  79. // #define putc        p2w_putc  -yeah right! not until we get pass-thru to system for non-console.
  80. #define putchar        p2w_putchar
  81. #define puts        p2w_puts
  82.  
  83. // ==== Std C library replacement routines
  84.  
  85. int p2w_fflush(FILE *stream);
  86. int p2w_fprintf(FILE *stream, const char *format, ...);
  87. int p2w_fputc(int theChar, FILE *stream);
  88. int p2w_fputs(const char *theString, FILE *stream);
  89. int p2w_printf(const char * format, ...);
  90. int p2w_putc(int theChar, FILE *stream);
  91. int p2w_putchar(const char theChar);
  92. int p2w_puts(const char *theString);
  93.  
  94.  
  95. #endif // STDIOP2W_H
  96.